home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / AUTOCK3.PAK / MAINFRM.CPP < prev    next >
C/C++ Source or Header  |  1997-05-06  |  3KB  |  118 lines

  1. // MainFrm.cpp : implementation of the CMainFrame class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1995 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14. #include "stdafx.h"
  15. #include "AutoClik.h"
  16.  
  17. #include "MainFrm.h"
  18.  
  19. #ifdef _DEBUG
  20. #define new DEBUG_NEW
  21. #undef THIS_FILE
  22. static char THIS_FILE[] = __FILE__;
  23. #endif
  24.  
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CMainFrame
  27.  
  28. IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
  29.  
  30. BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
  31.     //{{AFX_MSG_MAP(CMainFrame)
  32.         // NOTE - the ClassWizard will add and remove mapping macros here.
  33.         //    DO NOT EDIT what you see in these blocks of generated code !
  34.     ON_WM_CREATE()
  35.     //}}AFX_MSG_MAP
  36. END_MESSAGE_MAP()
  37.  
  38. static UINT indicators[] =
  39. {
  40.     ID_SEPARATOR,           // status line indicator
  41.     ID_INDICATOR_CAPS,
  42.     ID_INDICATOR_NUM,
  43.     ID_INDICATOR_SCRL,
  44. };
  45.  
  46. /////////////////////////////////////////////////////////////////////////////
  47. // CMainFrame construction/destruction
  48.  
  49. CMainFrame::CMainFrame()
  50. {
  51.     // TODO: add member initialization code here
  52.     
  53. }
  54.  
  55. CMainFrame::~CMainFrame()
  56. {
  57. }
  58.  
  59. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  60. {
  61.     if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
  62.         return -1;
  63.     
  64.     if (!m_wndToolBar.Create(this) ||
  65.         !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
  66.     {
  67.         TRACE0("Failed to create toolbar\n");
  68.         return -1;      // fail to create
  69.     }
  70.  
  71.     if (!m_wndStatusBar.Create(this) ||
  72.         !m_wndStatusBar.SetIndicators(indicators,
  73.           sizeof(indicators)/sizeof(UINT)))
  74.     {
  75.         TRACE0("Failed to create status bar\n");
  76.         return -1;      // fail to create
  77.     }
  78.  
  79.     // TODO: Remove this if you don't want tool tips
  80.     m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
  81.         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
  82.  
  83.     // TODO: Delete these three lines if you don't want the toolbar to
  84.     //  be dockable
  85.     m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
  86.     EnableDocking(CBRS_ALIGN_ANY);
  87.     DockControlBar(&m_wndToolBar);
  88.  
  89.     return 0;
  90. }
  91.  
  92. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  93. {
  94.     // TODO: Modify the Window class or styles here by modifying
  95.     //  the CREATESTRUCT cs
  96.  
  97.     return CMDIFrameWnd::PreCreateWindow(cs);
  98. }
  99.  
  100. /////////////////////////////////////////////////////////////////////////////
  101. // CMainFrame diagnostics
  102.  
  103. #ifdef _DEBUG
  104. void CMainFrame::AssertValid() const
  105. {
  106.     CMDIFrameWnd::AssertValid();
  107. }
  108.  
  109. void CMainFrame::Dump(CDumpContext& dc) const
  110. {
  111.     CMDIFrameWnd::Dump(dc);
  112. }
  113.  
  114. #endif //_DEBUG
  115.  
  116. /////////////////////////////////////////////////////////////////////////////
  117. // CMainFrame message handlers
  118.